package com.example.demo.repository;

import com.example.demo.domain.Catalog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * 帮助目录Repository
 * @Author zhengmf
 * @Date 2019/1/4  18:11
 */
@Repository
public interface CatalogRepository extends JpaRepository<Catalog,Long> {

    @Modifying
    @Query(value = "update Catalog set fullCatalogId =:fullCatalogId where catalogId =:catalogId")
    void setFullCatalogId(@Param(value = "fullCatalogId") String fullCatalogId,
                          @Param(value = "catalogId") Long catalogId);

}
